#include <iostream>
#include <vector>
#include<set>
#include<unordered_set>
#include<iomanip>
using namespace std;
vector<unordered_set<int>> f(110);
vector<int> M;
unordered_set<int> N;
int main()
{
    int n; cin >> n;
    for (int i = 1; i <= n; i++)
    {
        int k; cin >> k;
        for (int j = 1; j <= k; j++)
        {
            int x; cin >> x;
            f[i].emplace(x);
        }
    }
    int m; cin >> m;
    for (int i = 1; i <= m; i++)
    {
        int x; cin >> x;
        if (!N.count(x))
        {
            N.insert(x);
            M.emplace_back(x);
        }
    }
    int count = 0;
    for (auto& x : M)
    {
        bool flag = true;
        for (int j = 1; j <= n; j++)
        {
            if (f[j].count(x) && f[j].size() > 1)
                flag = false;
        }
        if (flag) cout <<setw(5) << setfill('0') <<  x << " ", count++;
    }
    if (!count) cout << "No one is handsome" << endl;
    return 0;
}